<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/12/13
  Time: 10:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" isELIgnored="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>欢迎管理员进入管理页面</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <script src="<%=request.getContextPath()%>/static/js/jquery-3.4.1.js" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/static/css/bootstrap.css" />
    <script src="<%=request.getContextPath()%>/static/js/bootstrap.js" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/button.css" />
    <script type="text/javascript">
        var system ={};
        var p = navigator.platform;
        system.win = p.indexOf("Win") == 0;
        system.mac = p.indexOf("Mac") == 0;
        system.x11 = (p == "X11") || (p.indexOf("Linux") == 0);
        if(system.win||system.mac||system.xll){//如果是电脑跳转到
            window.location.href="#";
        }else{  //如果是手机,跳转到
            window.location.href="${pageContext.request.contextPath}/index.jsp";
        }
    </script>
    <style type="text/css">

    </style>
</head>

<body>

<!-- 导航条-->
<nav class="navbar navbar-default">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                <span class="sr-only">切换导航栏</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#" style="padding: 0px;">

            </a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <p class="nav navbar-text"><span>管理员：${admin.adminName}</span></p>
                <p class="nav navbar-text"><span id="times"></span></p>
                <a class="nav navbar-text" href="${pageContext.request.contextPath}/admin/adminMainView"><span class="glyphicon glyphicon-home">首页</span></a>
                <button class="btn btn-danger navbar-btn" id="logout">
                    <span class="glyphicon glyphicon-off"></span>退出登录
                </button>
            </ul>

        </div>

    </div>
</nav>

<!-- 主体部分 -->
<div class="container-fluid">
    <div class="row">

        <!--左边部分 -->
        <div class="col-md-3">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <!-- 头像 -->
                    <div class="top-section" id="headPicture">
                        <div class="profile-image">
                            <a href="${pageContext.request.contextPath}/admin/adminDetails">
                                <img src="${admin.picture}" class="img-circle center-block" width="150px" height="150px">
                            </a>
                        </div>
                        <div class="profile-content">
                            <h3 class="profile-title text-center">${admin.adminName}</h3>
                            <p class="profile-description text-center">${admin.signature}</p>
                        </div>
                    </div>
                </div>

                <div class="panel-body">
                    <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">

                        <div class="panel panel-default" id="bodyList">
                            <div class="list-group">
                                <a href="${pageContext.request.contextPath}/user/users" class="list-group-item text-center">二次元用户管理</a>
                                <a href="${pageContext.request.contextPath}/anime/animes" class="list-group-item text-center">动漫信息管理</a>
                                <a href="${pageContext.request.contextPath}/region/regions" class="list-group-item text-center">发行地区管理</a>
                                <a href="${pageContext.request.contextPath}/type/types" class="list-group-item text-center">动漫类型管理</a>
                                <a href="${pageContext.request.contextPath}/enshrine/enshrines" class="list-group-item text-center">追番管理</a>
                                <a href="${pageContext.request.contextPath}/comment/comments" class="list-group-item text-center">评论管理</a>
                                <a href="${pageContext.request.contextPath}/admin/adminDetails" class="list-group-item text-center">编辑个人资料</a>
                            </div>
                        </div>

                    </div>
                </div>

                <div class="panel-footer">
                    <div class="box bg-1">
                        <button class="button button--antiman button--round-l button--text-medium" onclick="window.open('${pageContext.request.contextPath}/index.jsp')"><span>转到前台</span></button>
                    </div>
                </div>
            </div>

        </div>


        <!--右边部分 -->
        <div class="col-md-9">
            <div>
                <div class="panel panel-default">
                    <div class="panel-body">
                        <img src="<%=request.getContextPath()%>/static/img/2003.gif" alt="" width="100%" height="100%">
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
    //得到时间并写入div
    function getDate(){
        //获取当前时间
        var date = new Date();
        //格式化为本地时间格式
        var date1 = date.toLocaleString();
        //获取div
        var span = document.getElementById("times");
        //将时间写入div
        span.innerHTML = date1;
    }
    //使用定时器每秒向div写入当前时间
    setInterval("getDate()",1000);

    //退出登录
    $(document).on("click", "#logout", function() {
        if(confirm('是否要退出登录？')) {
            $.get(
                "${pageContext.request.contextPath}/admin/logout",
                function(data) {
                    window.location.reload();
                }, "json")
        }
    })
</script>

</html>
